log:=thirdparty/log/log.c thirdparty/log/log.h
apptime:=app/app_commonTime.c app/app_commonTime.h
appbuffer:=app/app_buffer.c app/app_buffer.h
cJSON:=thirdparty/cJSON/cJSON.c thirdparty/cJSON/cJSON.h
CC:=gcc
appmqtt:=app/app_mqtt1.c app/app_mqtt1.h

apppool:=app/app_pool.c app/app_pool.h
testlog: test/tlog.c $(log)
	-$(CC) $^ -o $@ -Ithirdparty
	-./$@
	-rm $@

test_apptime:test/ttime_app.c $(log) $(apptime)
	$(CC) $^ -o $@ -Ithirdparty -Iapp
	-./$@
	-rm $@

test_appbuff:test/tbuffer_app.c $(log) $(appbuffer)
	$(CC) $^ -o $@ -Ithirdparty -Iapp
	-./$@
	-rm $@

test_cJSON:test/cJSON.c $(log) $(cJSON)
	$(CC) $^ -o $@ -Ithirdparty 
	-./$@
	-rm $@


test_mqtt:test/mqtt_test.c 
	$(CC) $^ -o $@ -lpaho-mqtt3c
	-./$@
	-rm $@

appmqtt:test/appmqtt_test.c $(appmqtt) $(log)
	-$(CC) $^ -o $@ -Ithirdparty -lpaho-mqtt3c
	-./$@
	-rm $@

appmqtt2:test/app_mqtttest.c $(appmqtt) $(log)
	-$(CC) $^ -o $@ -Ithirdparty -lpaho-mqtt3c -Iapp
	-./$@
	-rm $@

app_pool:test/app_pool_test.c $(log) $(apppool)
	-$(CC) $^ -o $@ -Ithirdparty -Iapp
	-./$@
	-rm $@